package com.ktmall.ktmalluijava.pojo;

import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author ZhouShuang
 * @version 17
 * @Title
 * @date 2025/5/9 下午7:43
 */
@Getter
@Setter
public class Goods {
    private Integer id; //商品编号
    private String goodsName; //商品名称
    private String spuCode; //商品的SPU商品的唯一标识
    private Integer categoryId; //商品的二级分类id，外键，引用与t_goods_category表
    private Integer brandId; //商品品牌id
    private  String goodsImg; //商品图片
    private String goodsDesc; //商品描述
    private BigDecimal goodsPrice; //商品价格
    private Integer publishStatus ;//上架状态(0.下架 1.上架)
    private Integer orderNum ;//排序值
    private String mainPictures; //商品主图的地址，有多张使用，隔开
    private String [] mainImg ; //商品图片数组
    private String detailsPictures ; //商品详情图片的地址，有多张使用，隔开
    private String [] details ; //商品详情图片数组
    private String createTime; //创建时间
    private String updateTime; //修改时间
    private Category category ; //商品分类对象
    private List<Sku> skus ; //商品的sku列表
    private List<Attr> specs ; //商品的规格属性
    private  Brand brand; //商品的品牌对象

    public Goods(){

    }

    public Goods(Integer id, String goodsName, String spuCode, Integer categoryId, Integer brandId, String goodsImg, String goodsDesc, BigDecimal goodsPrice, Integer publishStatus, Integer orderNum, String mainPictures,String detailsPictures, String createTime, String updateTime, Category category, List<Sku> skus, List<Attr> specs, Brand brand) {
        this.id = id;
        this.goodsName = goodsName;
        this.spuCode = spuCode;
        this.categoryId = categoryId;
        this.brandId = brandId;
        this.goodsImg = goodsImg;
        this.goodsDesc = goodsDesc;
        this.goodsPrice = goodsPrice;
        this.publishStatus = publishStatus;
        this.orderNum = orderNum;
        this.mainPictures = mainPictures;
        this.mainImg = mainPictures.split(",");
        this.detailsPictures = detailsPictures;
        this.details = detailsPictures.split(",");
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.category = category;
        this.skus = skus;
        this.specs = specs;
        this.brand = brand;
    }
}
